<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <title>书签管理器</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

    <link rel="stylesheet" href="./bootstrap.css">
    <script src="./bootstrap.js"></script>
    <script src="./vue.js"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <!--
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https:/unpkg.com/vue/dist/vue.js"></script>
    -->
    <link rel="stylesheet" href="./main.css">
</head>
<body>
<div class="main-panel" id="app">
    <div class="sub-panel" id="left-panel">
        <ul class="list-group">
            <li class="list-group-item background-color-1">
                <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#addNewDir">添加目录
                </button>
                <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#addNewBookMark">添加书签

            </li>

        </ul>
        <ul class="list-group">
            <li clsss="list-group-item" data-toggle="collapse" data-target="#demo">
                <span class="glyphicon glyphicon-bookmark"></span>
                <span>我的书签</span>
                <span class="glyphicon glyphicon-chevron-down"></span>
            </li>
        </ul>
        <div id="demo" class="collapse">
            <ul class="list-group">
                <template v-for="bmdir in DirItems">
                    <li class="list-group-item item-select">
                        <a>{{bmdir.name}}</a>
                        <span class="glyphicon glyphicon-option-vertical navbar-right" data-toggle="modal"
                              data-target="#editDir"></span>
                    </li>

                </template>
            </ul>
        </div>
    </div>

    <div class="sub-panel" id="right-panel">
        <div>
            <input type="text" class="form-control" placeholder="search..">
        </div>
        <div>
            <template v-for="bookmark in BookMarksList">
                <li class="list-group-item item-select">
                    <input type="checkbox"/>
                    <a v-bind:href="bookmark.link" target="_blank">{{bookmark.name}}</a>
                    <span class="glyphicon glyphicon-option-vertical navbar-right"></span>
                </li>
            </template>
        </div>
    </div>
    <!-- model for edit dir info -->
    <div class="modal right fade" id="editDir" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <p>hello</p>
                </div>
            </div>
        </div>
    </div>

    <!-- modal for adding new bookmark  -->

    <div class="modal fade" id = "addNewBookMark">
        <div class="modal-dialog">
            <div class ="modal-content">
                <div class="modal-header">
                    <p>添加书签</p>
                </div>
                <div class="modal-body">
                    <p>名称</p>
                    <input type="text" v-model="newBookMarkName">
                    <p>链接</p>
                    <input type="text" v-model="newBookMarkLink">
                    <p>目录</p>
                    <input type="text" v-model="newBookMarkDir">
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default" data-dismiss="modal" v-on:click="addNewBookMark">确定</button>
                    <button class="btn btn-default" data-dismiss="modal" >取消</button>
                </div>
            </div>
        </div>
    </div>
    <!-- dialog for add new bookmarks dir -->
    <div class="modal fade" id="addNewDir" role="dialog">
        <div class="modal-dialog">
            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">新建文件夹</h4>
                </div>
                <div class="modal-body">
                    <p>名称</p>
                    <input type="text" class="form-control" placeholder="新文件名称" v-model="newDirName">
                    <ul class="form-control" style="background-color:darkgray">
                        <li data-toggle="collapse" data-target="#showCurrDir">
                            <span class="glyphicon 	glyphicon glyphicon-menu-right"></span>
                            <span>父文件夹:</span> <span>{{selectedParentDir}}</span>
                        </li>
                    </ul>
                    <div id="showCurrDir" class="collapse">
                        <ul class="list-group">
                            <template v-for="bmdir in DirItems">
                                <li class="list-group-item item-select" v-on:click="onSelectParentDir">
                                    <span class="glyphicon glyphicon-folder-close"></span>
                                    <span>{{bmdir.name}}</span>
                                    <span class="glyphicon glyphicon-ok" v-if="bmdir.ItemSelected =='true'"></span>
                                </li>
                            </template>
                        </ul>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" v-on:click="addNewDir">OK
                    </button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="bookmark.js"></script>

</html>
